package com.xq.jltx.ffmpegmultiplehello;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity implements View.OnClickListener{

    Button formatBtn;
    Button codecBtn;
    Button filterBtn;
    Button configBtn;

    TextView mInfoTv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // Example of a call to a native method
        formatBtn = findViewById(R.id.format_btn);
        codecBtn = findViewById(R.id.code_btn);
        filterBtn = findViewById(R.id.filter_btn);
        configBtn = findViewById(R.id.config_btn);
        mInfoTv = findViewById(R.id.info_tv);

        formatBtn.setOnClickListener(this);
        codecBtn.setOnClickListener(this);
        filterBtn.setOnClickListener(this);
        configBtn.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.format_btn:
                mInfoTv.setText(FFmpegLearn.avformatInfo());
                break;
            case R.id.code_btn:
                mInfoTv.setText(FFmpegLearn.avcodecInfo());
                break;
            case R.id.filter_btn:
                mInfoTv.setText(FFmpegLearn.avfilterInfo());
                break;
            case R.id.config_btn:
                mInfoTv.setText(FFmpegLearn.configurationInfo());
                break;
            default:
                break;
        }
    }


}
